#region License

// This file is part of Grawlix.
// 
// Grawlix is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
// Grawlix is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public
// License along with Grawlix.  If not, see
// <http://www.gnu.org/licenses/>.

#endregion

using System;

namespace Grawlix.Services.Resources
{
	/// <summary>
	/// A component of an 
	/// <see cref="AbstractResourceFactory{TDeclare,TDefine}"/>that
	/// creates the resources.
	/// </summary>
	/// <typeparam name="TDeclare">The type of resource that the
	/// creator declares it creates.
	/// </typeparam>
	/// <typeparam name="TDefine">The type of resource the creator
	/// actually creates.
	/// </typeparam>
	[Serializable]
	public abstract class AbstractResourceProxyCreator<TDeclare,
	                                                   TDefine>
		where TDeclare : IDynamicResource
		where TDefine : AbstractResourceProxy<TDeclare, TDefine>,
			TDeclare
	{
		/// <summary>
		/// Creates a local proxy for the resource with the specified
		/// identifier.
		/// </summary>
		/// <param name="identifier">The identifier of the resource.
		/// </param>
		/// <returns>The new proxy.</returns>
		public abstract TDefine Create(Uri identifier);
	}
}